home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4452 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Message-ID: <4ejl6d$1ck@news00.btx.dtag.de>
  3. From: PHoersemann@t-online.de (Peter Hrsemann)
  4. Path: news00.btx.dtag.de!not-for-mail!PHoersemann
  5. Subject: Multithreading with BC4.5
  6. Date: Mon, 29 Jan 1996 22:28:13 +0000
  7. X-Gateway: ZCONNECT XX ius.gun.de [UNIX/Connect v0.73]
  8. MIME-Version: 1.0
  9. Content-Type: text/plain; charset=ISO-8859-1
  10. Content-Transfer-Encoding: 8bit
  11.  
  12. Hello Folks !
  13.  
  14. This is my first posting to a newsgroup and I hope to get plenty of
  15. feedback :-)
  16.  
  17. My problem:
  18. I want to call a member function of an existing object as a background
  19. thread. Therefore I created a friend function in its class :
  20.  
  21. void friendfunc(void* obj)
  22.  
  23. , which is called by:
  24.  
  25. _beginthread(friendfunc,4096,(void*)obj);
  26.  
  27. In this friend function, I want to call a member function of obj.
  28. Because of its actual type void*, I have to do a type conversion.
  29. But how ?? What is the correct type conversion, so I am able to call
  30. obj.memberfunc ?
  31. Is there a complete different (better?) way to solve the whole problem
  32. ?
  33.  
  34. Thanks, Peter Hoersemann, PHoersemann@t-online.de, Germany
  35.  
  36.